package ru.home.documentmanager.model.dto;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;

public class UserModel extends User implements UserDetails {

    private static final long serialVersionUID = -6951054647581868084L;

    private ru.home.documentmanager.model.User user;

    public UserModel(ru.home.documentmanager.model.User user,
            boolean accountNonExpired, boolean credentialsNonExpired,
            boolean accountNonLocked,
            Collection<? extends GrantedAuthority> authorities) {
        super(user.getUsername(), user.getPassword(), user.isEnabled(),
                accountNonExpired, credentialsNonExpired, accountNonLocked,
                authorities);
        this.user = user;
    }

    public UserModel(String username, String password, boolean enabled,
            boolean accountNonExpired, boolean credentialsNonExpired,
            boolean accountNonLocked,
            Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired,
                credentialsNonExpired, accountNonLocked, authorities);
    }

    public UserModel(String username, String password,
            Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

    public ru.home.documentmanager.model.User getUserObject() {
        return user;
    }

    public void setUserObject(ru.home.documentmanager.model.User user) {
        this.user = user;
    }

}